#include <iostream>

using namespace std;
int main()
{
	
	int flag1 = 0,flag2 = 0,flag3 = 0,flag4 = 0;
	int num = 0;
	cin >> num;
	int arr1[4] = {6,8,10,12};
	int arr2[11] = {0,2,4,5,6,7,8,9,10,11,12};
	int arr3[7] = {0,2,4,5,7,9,11};
	
	for(int i = 0;i<4;i++){
		if(num == arr1[i])
		{
			flag1 = 1;
			break;
		}
	}
	
	for(int i = 0;i<11;i++){
		if(num == arr2[i])
		{
			flag2 = 1;
			break;
		}
	}
	
	for(int i = 0;i<7;i++){
		if(num == arr3[i])
		{
			flag3 = 1;
			break;
		}
	}
	if(num>=14 && (num % 2) == 0){
		flag3 = 1;
	}
	
	
	
	if(num % 2 == 1){
		if(num != 5&&num != 7&&num != 9&&num != 11){
			flag4 = 1;
		}
		else{
			flag4 = 0;
		}
	}else{
		flag4 = 0;
	}
	
	cout << flag1 <<" "<<flag2<<" "<<flag3<<" "<<flag4 <<endl;
	
	return 0;
} 
